program to input matrix in python